GPUs are widely used to accelerate the processing of 2D and 3D graphics by offloading the computing-intensive routines from the central processing unit (CPU), thereby greatly improving graphics performance in computing systems. Since GPUs vary greatly in their architectures and command-sets, high level APIs have been designed to provide a common language for developing applications that take advantage of the GPU's capabilities without having to know the details of the specific GPU. Examples of such languages include OpenGL, OpenCL, Direct3D, and OpenVG.
Virtualization of a GPU device is useful to allow multiple independent environments shared access to the GPU hardware device. For example, in the context of desktop virtualization, Windows and Linux virtual machines (VMs) may be concurrently running on a computer, each with applications requiring GPU acceleration. In another example, an application running on a remote access server may wish to use the GPU of the client computer that is providing the user interface (UI).
Virtualization of the GPU is most commonly implemented by intercepting an application's use of high level (e.g., OpenGL) APIs and forwarding the operations to another environment (VM or another machine) containing access to the GPU, where the high level API is translated into the GPU specific commands. For example, in a remote desktop environment, the application (running on the server) has its use of OpenGL commands intercepted (E.g. by an implementation of the OpenGL library) and forwarded to the client machine where the OpenGL commands are injected into the client's native OpenGL library and rendered to the client's display.
GPU virtualization may also be implemented in a stand-alone manner without any display hardware. Many GPU devices are memory-to-memory devices, and do not depend on a physical display. The GPU takes input commands and textures from memory, and composes an output scene into memory. In some implementations of GPU virtualization, the output scene in memory is then redirected to a remote display using an unrelated technique, such as sending frames as compressed images over a network. In other implementations, the GPU may be used as a general purpose processor for accelerating computation intensive workloads, especially highly parallelizable non-graphical computation such as scientific simulations and bioinformatics.
A hardware approach to GPU virtualization generally includes designing the GPU device itself to support virtualization. Typically this means that the GPU hardware supports multiple independent GPU software stacks communicating with it concurrently. The GPU is required to keep track of each GPU software stack context (e.g. one per guest OS) and perform its own scheduling of commands from the different guests. This approach is limited by the GPU hardware, which often has no virtualization support, or only a limited number of contexts.
Another approach to GPU virtualization involves time-sharing the use of the GPU hardware itself through a process mediated by a Hypervisor, and supported by a specially modified version of the vendor's graphics software stack. In this approach, each VM has access to the GPU hardware for a certain period of time, and directly controls the GPU hardware during this time. This and each of the preceding virtualization techniques are undesirable in various respects.
Accordingly, it is desirable to provide improved methods and systems for GPU virtualization. Furthermore, other desirable features and characteristics of the present invention will become apparent from the subsequent detailed description and the appended claims, taken in conjunction with the accompanying drawings and the foregoing technical field and background.